<?php
/**
 * Created by PhpStorm
 * USER MingTingLiang   QQ 915802070
 * Date 2020-12-15-015   18:15
 */


class AgreePlugin     // implements IPlugin
{
    // 第三方不合作开发商
    public function __construct(INews $news)
    {
        $news->regPlug(new class implements IPlugin {

            public function update($id)
            {
                // TODO: Implement update() method.
                echo "<hr />";
                echo "新闻id为{$id}的投票量加1" . date('Y-m-d H:i:s');
            }

            public function __toString()
            {
                // TODO: Implement __toString() method.
                return "AgreePlugin";
            }
        });
    }


}